<template>
  <div>
    <h2 class="count">我是Count组件</h2>
    <h2>{{$store.state.Count.num}}</h2>
    <h2>num:{{num}}</h2>
    <h2>doubleNum:{{doubleNum}}</h2>
    <h2>下方列表总数为{{musicList.length}}</h2>
    <button @click="addNum({n:10})">点击加10---mutation</button>
    <button @click="incrementWait({n:10})">点击加10---action</button>
  </div>
</template>

<script>
import {mapActions, mapGetters, mapMutations, mapState} from "vuex";

export default {
  name: "Count",
  computed:{
    ...mapGetters('Count',['doubleNum']),
    ...mapState('Count',['num']),
    ...mapState('Music',['musicList'])
  },
  methods:{
    ...mapActions('Count',['incrementWait']),
    ...mapMutations('Count',['addNum'])
  }
}
</script>

<style scoped>

</style>